package com.sendinfo;

/**
 * 文件返回对象
 * 
 * @author 席恒昌
 * @Date 2017年8月9日
 * @Description
 */
public class FileRes {

	private String code;// 0-成功 ，其他为失败
	private String message;// 信息

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * 得到默认的BaseRes即错误的res
	 * 
	 * @param code
	 * @param message
	 * @return FileRes
	 */
	public static FileRes getErrorRes(String code, String msg) {
		FileRes ret = new FileRes();
		ret.setCode(code);
		ret.setMessage(msg);
		return ret;
	}

	public FileRes toErrorRes(String code, String msg) {
		this.setCode(code);
		this.setMessage(msg);
		return this;
	}

	public static FileRes getSuccessRes(String msg) {
		FileRes ret = new FileRes();
		ret.setCode("0");
		ret.setMessage(msg);
		return ret;
	}

	public FileRes toSuccessRes(String msg) {
		this.setCode("0");
		this.setMessage(msg);
		return this;
	}

}
